<!DOCTYPE html>
<html lang="zh">

<head>
  <title>seeders-admin后台管理模板2.0</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <link rel="stylesheet" href="static/css/bootstrap.min.css" />
  <link rel="stylesheet" href="static/css/font-awesome.min.css" />
  <link rel="stylesheet" href="static/css/sdxmenu.css" />
  <link rel="stylesheet" href="static/css/seeder-admin.css" />

</head>

<body>
  <nav class="navbar navbar-expand-lg navbar-light fixed-top" style="background-color: #ffffff;">
    <a class="navbar-brand sdx-trigger">seeder-admin2.0</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarbody"
      aria-controls="navbarbody" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarbody">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item active">
          <a class="nav-link" href="index.html">首页</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="javascript:void(0)">平台</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="javascript:void(0)">商城</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="javascript:void(0)">资金</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="javascript:void(0)">招商</a>
        </li>
      </ul>

      <ul class="navbar-nav">
        <li class="nav-item active dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
            aria-haspopup="true" aria-expanded="false">
            <img class="sd-img-avatar" src="static/imgs/avatar.png" alt="管理员" />
            admin888
          </a>
          <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
            <a class="dropdown-item" href="#">个人信息</a>
            <a class="dropdown-item" href="#">修改密码</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="page_login.html">退出登录</a>
          </div>
        </li>
      </ul>
    </div>
  </nav>

  <aside class="sdxmenu-wrapper" data-sdxmenu>
    <div class="sdxmenu-scroll-box">
      <ul class="sdxmenu">
        <li>
          <a href="javascript:void(0)" class="fa fa-search">
            <input placeholder="请输入搜索内容" class="sdxmenu-search" /></a>
        </li>

        <li><a href="javascript:void(0)" class="fa fa-home">关于</a></li>

        <li class="sdxmenu-item-has-submenu">
          <a href="javascript:void(0)" class="fa fa-wrench">工具类</a>
          <ul class="sdxmenu-submenu">
            <li>
              <a href="javascript:void(0)" class="fa fa-code-fork">浮动</a>
            </li>
          </ul>
        </li>
        <li class="sdxmenu-item-has-submenu">
          <a href="javascript:void(0)" class="fa fa-check-square-o">表单</a>
          <ul class="sdxmenu-submenu">
            <li>
              <a href="forms_demo.html" class="fa fa-code-fork">演示</a>
            </li>
            <li>
              <a href="forms_control.html" class="fa fa-code-fork">控件</a>
            </li>
            <li>
              <a href="forms_validate.html" class="fa fa-code-fork">验证</a>
            </li>

          </ul>
        </li>

        <li class="sdxmenu-item-has-submenu">
          <a href="javascript:void(0)" class="fa fa-building">组件</a>
          <ul class="sdxmenu-submenu">
            <li>
              <a href="component_button.html" class="fa fa-code-fork">按钮</a>
            </li>
            <li>
              <a href="component_badge.html" class="fa fa-code-fork">徽章</a>
            </li>
            <li>
              <a href="component_alert.html" class="fa fa-code-fork">警告框</a>
            </li>
            <li>
              <a href="component_table.html" class="fa fa-code-fork">表格</a>
            </li>
            <li>
              <a href="component_datepicker.html" class="fa fa-code-fork">日期选择器</a>
            </li>
            <li>
              <a href="component_richtext.html" class="fa fa-code-fork">富文本</a>
            </li>
          

          </ul>
        </li>

        <li class="sdxmenu-item-has-submenu">
          <a href="javascript:void(0)" class="fa fa-paper-plane-o">页面</a>
          <ul class="sdxmenu-submenu">
            <li>
              <a href="page_login.html" class="fa fa-code-fork">登录页面</a>
            </li>
            <li>
              <a href="page_curd.html" class="fa fa-code-fork">curd页面</a>
            </li>

          </ul>
        </li>



        <li class="sdxmenu-item-has-submenu">
          <a href="javascript:void(0)" class="fa fa-tachometer">仪表盘</a>
          <ul class="sdxmenu-submenu">
            <li>
              <a href="dashboard_chart.js.html" class="fa fa-code-fork">chart.js</a>
            </li>
            <li>
              <a href="javascript:void(0)" class="fa fa-code-fork">echartsjs.js(百度产品)</a>
            </li>
          </ul>
        </li>


        <li><a href="javascript:void(0)" class="fa fa-home">图标</a></li>
      </ul>
    </div>
  </aside>
  <main class="container">
    <div class="row">
      <div class="col-sm-6 mt-5">
        <form id="signupForm" method="POST" accept="#">
          <div class="form-group row">
            <label  class="col-sm-2 col-form-label">用户名</label>
            <div class="col-sm-10">
              <input type="text" name="username" autocomplete="off" class="form-control"  />
            </div>
          </div>

          <div class="form-group row">
            <label  class="col-sm-2 col-form-label">密码</label>
            <div class="col-sm-10">
              <input type="password" name="password" autocomplete="off" class="form-control" id="password" />
            </div>
          </div>

          <div class="form-group row">
            <label  class="col-sm-2 col-form-label">确认密码</label>
            <div class="col-sm-10">
              <input type="password" name="confirm_password" autocomplete="off" class="form-control" />
            </div>
          </div>

          <div class="form-group row">
            <label  class="col-sm-2 col-form-label">邮箱</label>
            <div class="col-sm-10">
              <input type="text" name="email" autocomplete="off" class="form-control"  />
            </div>
          </div>

          <div class="form-group row">
 
            <div class="col-sm-10 offset-sm-2">
              <div class="form-check">
                <input class="form-check-input" name="agree" type="checkbox" >
                <label class="form-check-label" >
                 您必须同意我们的协议
                </label>
              </div>
            </div>
          </div>

          <div class="form-group row">
            <label for="vegetables" class="col-sm-2 col-form-label">蔬菜</label>
            <div class="col-sm-10">
              <select id="vegetables"   class="form-control" name="vegetables" >
                <option value="">请选择爱吃的蔬菜</option>
                <option value="p">1</option>
                <option value="t">2</option>
                <option value="s">3</option>
       
              </select>
            </div>
          </div>

          <div class="form-group row">
            <label for="vegetables" class="col-sm-2 col-form-label">蔬菜</label>
            <div class="col-sm-10">
              <select multiple  class="form-control" name="vegetables1" >
                <option value="p">1</option>
                <option value="t">2</option>
                <option value="s">3</option>
              </select>
            </div>
          </div>

          <div class="form-group row mb-5">
            <div class="col-sm-10">
              <button type="submit" class="btn btn-xs btn-primary">
                Sign in
              </button>
            </div>
          </div>

        </form>



      </div>

      <div class="col-sm-6 mt-5">


        <h2>表单验证插件示例</h2>
        <p>如果你是一个追求美感的少年,那么你可以掏钱购买 <code>FormValidation v1.6</code> 我在seedersadmin1.0中用的就是它</p>
        <p>当然了，我是白嫖的</p>
        <p>奈何那个版本无法完美支持bootstrap4,所以找了一个替代品<code>jquery-validate</code></p>
        <p>不过幸运的是这款插件的demo中我看到了支持bs4，效果也还过得去</p>
        <p><a href="https://jqueryvalidation.org/">jQuery Validate 官网</a></p>
        <p><a href="https://www.runoob.com/jquery/jquery-plugin-validate.html">jQuery Validate 菜鸟教程</a></p>



      </div>
    </div>
  </main>
  <!-- 公共部分 -->
  <script src="static/js/jquery-3.4.1.min.js"></script>
  <script src="static/js/popper.min.js"></script>
  <script src="static/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="static/js/sdxmenu.js"></script>
  <script type="text/javascript" src="static/js/seeders-admin.js"></script>

  <!-- 表单验证插件 -->

  <script type="text/javascript" src="lib/jquery-validate/jquery.validate.min.js"></script>
  <script type="text/javascript" src="lib/jquery-validate/localization/messages_zh.min.js"></script>

  <script type="text/javascript">
    $("#signupForm").validate({
      rules: {
        username: {
          required: true,
          minlength: 2,
        },
        password: {
          required: true,
          minlength: 5,
        },

        confirm_password: {
          required: true,
          minlength: 5,
          equalTo: "#password",
        },
        email: {
          required: true,
          email: true,
        },
        agree: "required",
        vegetables: {
          required: true,
         
         
        },
        vegetables1: {
          required: true,
          minlength: 2,
         
        },

      },

      //下面是对bootstrap4的支持
      errorElement: "em",
      errorPlacement: function (error, element) {
       error.addClass("invalid-feedback");

        if (element.prop("type") === "checkbox") {
          error.insertAfter(element.next("label"));
        } else {
          error.insertAfter(element);
        }
      },
      highlight: function (element, errorClass, validClass) {
        $(element).addClass("is-invalid").removeClass("is-valid");
      },
      unhighlight: function (element, errorClass, validClass) {
        $(element).addClass("is-valid").removeClass("is-invalid");
      }
    });
  </script>
</body>

</html>